home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / DEMO_APP / MESSAGE.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  13.9 KB  |  466 lines

  1. package sub_arctic.demo_apps;
  2.  
  3. /**
  4.  * This is just a little class that represents a mail message.
  5.  */
  6.  
  7. import java.util.Vector;
  8.  
  9. public class message {
  10.   String _from;
  11.   public String from() { return _from;}
  12.   String _date;
  13.   public String date() { return _date;}
  14.   String _subject;
  15.   public String subject() { return _subject;}
  16.   String _text;
  17.   public String text() { return _text;}
  18.   String _to;
  19.   public String to() { return _to;}
  20.   /**
  21.    * Must be 0-3 0=from 1=date 2=subject 3=to
  22.    */
  23.   int _display_field=0;
  24.   /**
  25.    * Construct one given the right strings.
  26.    * @param String f from
  27.    * @param String d date
  28.    * @param String s subject
  29.    * @param String t to
  30.    * @param String txt text
  31.    */
  32.   public message(String f, String d, String s, String t, String txt) {
  33.     _from=f;
  34.     _date=d;
  35.     _subject=s;
  36.     _text=txt;
  37.     _to=t;
  38.   }
  39.   /**
  40.    * This method sets which field gets displayed when this object
  41.    * is converted to a string. This is convenient for use with
  42.    * the object_list_element since it will just convert the
  43.    * object to a string. Set this to be a value from 0 to 3
  44.    * 0=from 1=date 2=subject 3=to
  45.    */
  46.   public void set_display_field(int x) {
  47.     switch (x) {
  48.     case 0:
  49.     case 1:
  50.     case 2:
  51.     case 3:
  52.       _display_field=x;
  53.       break;
  54.     default:
  55.       _display_field=0;
  56.       break;
  57.     }
  58.   }
  59.   /**
  60.    * Copy a message object.
  61.    */
  62.   public message copy() {
  63.     return new message(from(),date(),subject(),to(),text());
  64.   }
  65.   /**
  66.    * Convert this message to a string.
  67.    */
  68.   public String toString() {
  69.     switch (_display_field) {
  70.     case 0:
  71.       return from();
  72.     case 1:
  73.       return date();
  74.     case 2:
  75.       return subject();
  76.     case 3:
  77.       return to();
  78.     }
  79.     /* FAIL SAFE */
  80.     return "BAD VALUE IN toString()";
  81.   }
  82.   /**
  83.    * This is how many messages we have hard coded into this file.
  84.    */
  85.   static final int number_messages=11;
  86.   /**
  87.    * Create a bunch of these objects. We just have some hard coded data
  88.    * in here to make things easy.
  89.    *
  90.    * @return Vector a collection of message objects
  91.    */
  92.   public static Vector retreive_messages() {
  93.     Vector result=new Vector();
  94.     String[] f=new String[number_messages];
  95.     String[] to=new String[number_messages];
  96.     String[] s=new String[number_messages];
  97.     String[] d=new String[number_messages];
  98.     String[] text=new String[number_messages];
  99.     int i,count=0;
  100.     /*
  101.      * Construct the messages
  102.      */
  103. f[count]="eugene@cc.gatech.edu (Eugene Liang)";
  104. to[count]="iansmith@Eng";
  105. s[count]="Confirmation";
  106. d[count]="Thu, 15 Aug 1996 17:21:22 -0400 (EDT)";
  107. text[count]=
  108. "\n" +
  109. "Ian,\n" +
  110. "\n" +
  111. "Just want to confirm the Lab Tour tomorrow at 9:00?\n" +
  112. "\n" +
  113. "-Eugene\n" +
  114. "\n" +
  115. "\n" ;
  116. count++;
  117. f[count]="Elizabeth Mynatt <mynatt@parc.xerox.com>";
  118. to[count]="burgess@interval.com, christina@communities.com, colleen.kehoe@Eng";
  119. s[count]="Birthday Celebration for Keith";
  120. d[count]="Thu, 15 Aug 1996 14:52:03 PDT";
  121. text[count]=
  122. "\n" +
  123. "1966 was a busy year as another person in our midst is turning 30\n" +
  124. "in just a few days.  If you would like to help Keith enter into\n" +
  125. "a new decade of his life, please join him for a night of good food,\n" +
  126. "music and company.\n" +
  127. "\n" +
  128. "Details:\n" +
  129. "\n" +
  130. "  Dinner:  The House\n" +
  131. "    Location: 1230 Grant Ave (near Columbus and Cafe Trieste)\n" +
  132. "    Time: 8pm, reservations under \"Keith\"\n" +
  133. "\n" +
  134. "    As reviewed by Patricia Unterman, this \"inexpensive restaurant\n" +
  135. "    combines Asian and Western incredients and techniques... This food\n" +
  136. "    is seriously good.\"\n" +
  137. "\n" +
  138. "    Before 8pm, Keith can likely be found at nearby Cafe Trieste.\n" +
  139. "\n" +
  140. "   Music: Grant and Green's\n" +
  141. "    Following dinner, we're off to hear Jonny Nitro at G&G.\n" +
  142. "\n" +
  143. "Birthday gag gifts are optional.  Since Keith invariably shows up\n" +
  144. "to work on Mondays with a CA \"but it was cloudy\" sunburn, one\n" +
  145. "suggestion is to shower him with different levels of sunblock (4 8\n" +
  146. "15 30 40 45 and 50).  Give a yell if you would like to be assigned\n" +
  147. "your own SPF number.\n" +
  148. "\n" +
  149. "Please RSVP so that I can appropriately modify the dinner reservations.\n" +
  150. "\n" +
  151. "Cheers,\n" +
  152. "Beth\n" +
  153. "\n" +
  154. "\n" +
  155. "\n" +
  156. "\n" ;
  157. count++;
  158. f[count]="colleenk@kehoe (Colleen Kehoe)";
  159. to[count]="tom.rodriguez@eng, iansmith@klimpt";
  160. s[count]="64MB?";
  161. d[count]="Thu, 15 Aug 1996 16:59:23 -0700";
  162. text[count]=
  163. "\n" +
  164. "\n" +
  165. "I finally got around to doing this and I've got twice the memory I\n" +
  166. "thought I had...any clues as to why the machine is so slow?\n" +
  167. "\n" +
  168. "kehoe-273% whatami\n" +
  169. "               DATE: Thu Aug 15 16:55:33 PDT 1996\n" +
  170. "               USER: colleenk\n" +
  171. "           HOSTNAME: le0 = kehoe\n" +
  172. "         IP ADDRESS: le0 = 129.144.152.132\n" +
  173. "              MODEL: SUNW,Sun 4/75\n" +
  174. "    FRAME BUFFER(S): cgsix\n" +
  175. "      SunOS RELEASE: 5.5.1\n" +
  176. "               TYPE: unknown (/=unknown, swap=, /usr=unknown, /home=unknown)\n" +
  177. "             MEMORY: 64MB\n" +
  178. "               SWAP: 193.5MB total, 59.9MB used, 133.6MB available\n" +
  179. "       LOAD AVERAGE: 1.03, 0.42, 0.35\n" +
  180. "     DNS DOMAINNAME: Eng.Sun.COM\n" +
  181. "     NIS DOMAINNAME: DGDO.Eng.Sun.COM\n" +
  182. "    DEFAULT PRINTER: mayday\n" +
  183. "   ETHERNET ADDRESS: 8:0:20:f:2b:13\n" +
  184. "             HOSTID: 5541379e\n" +
  185. "             FLOPPY: fd0 (3.5-inch floppy)\n" +
  186. "\n" +
  187. "----------------------------------------------------------------------\n" +
  188. "Colleen Kehoe (colleen.kehoe@eng.sun.com)\n" +
  189. "\n" +
  190. "\n" +
  191. "\n" +
  192. "\n" ;
  193. count++;
  194.  
  195. f[count]="ESPNET SportsZone <sportszone1@LISTSERV.STARWAVE.COM>";
  196. to[count]="Multiple recipients of list SPORTSZONE-NEWS";
  197. s[count]="ESPNET Fantasy Football '96 is here...";
  198. d[count]="Fri, 16 Aug 1996 13:29:26 -0700";
  199. text[count]=
  200. "\n" +
  201. "August 16, 1996\n" +
  202. "\n" +
  203. "Greetings ESPNET SportsZone fan,\n" +
  204. "\n" +
  205. "ESPNET SportsZone Fantasy Football '96 is here.  This announcement is being\n" +
  206. "sent to all of our friends including subscribers, participants of past games\n" +
  207. "and contests, and those who specifically requested more information about\n" +
  208. "ESPNET SportsZone Fantasy Football '96.\n" +
  209. "\n" +
  210. "While we are proud of our past games and contests, we think you'll agree\n" +
  211. "that this game has got it all.  Immediate roster updates.  Free unlimited\n" +
  212. "transactions.  Draft aids.  Expert analysis.  Scouting reports.  And one\n" +
  213. "all-inclusive low price ($29.95) for the entire season with no hidden fees.\n" +
  214. "ESPNET SportsZone's Fantasy Football '96 is far and away the best fantasy\n" +
  215. "game anywhere. Whether you are a fantasy rookie or veteran, this is the game\n" +
  216. "for you.\n" +
  217. "\n" +
  218. "If you haven't done so already, take a minute and discover for yourself the\n" +
  219. "exciting features of this year's game.  Simply cut the address below and\n" +
  220. "paste it into your browser:\n" +
  221. "\n" +
  222. "http://espnet.sportszone.com/tour/Fantasy/ffl96/gateway.html\n" +
  223. "\n" +
  224. "But don't delay.  Teams and leagues are forming right now and sign-ups end\n" +
  225. "in less than two weeks.  If you've already registered to play, we thank you\n" +
  226. "and hope you enjoy the football season.\n" +
  227. "\n" +
  228. "The Fantasy Team\n" +
  229. "\n" +
  230. "\n" ;
  231. count++;
  232. f[count]="dhuff@hangtime (Daryl Huff)";
  233. to[count]="iansmith@Eng";
  234. s[count]="CPT IV";
  235. d[count]="Fri, 16 Aug 1996 07:46:20 -0700";
  236. text[count]=
  237. "\n" +
  238. "Try it again.  I had forgotten to add you and Dave to the group file.  I've\n" +
  239. "moved the save date back to Friday 6pm.\n" +
  240. "\n" +
  241. "Daryl\n" +
  242. "\n" +
  243. "> From iansmith@klimpt Thu Aug 15 17:20 PDT 1996\n" +
  244. "> To: dhuff@hangtime (Daryl Huff)\n" +
  245. "> Subject: CPT IV\n" +
  246. "> \n" +
  247. "> I tried logging in and got nowhere due to authorization failure... I\n" +
  248. "> used \"iansmith\" & \"iansmith0\"...\n" +
  249. "> \n" +
  250. "> ian\n" +
  251. "\n" +
  252. "\n" +
  253. "\n" ;
  254. count++;
  255. f[count]="Keith Edwards <kedwards@parc.xerox.com>";
  256. to[count]="subarctic-discuss@cc.gatech.edu";
  257. s[count]="color picker interactor?";
  258. d[count]="Fri, 16 Aug 1996 10:50:59 PDT";
  259. text[count]=
  260. "\n" +
  261. "Has anyone written (or is anyone planning to write) a color picker\n" +
  262. "interactor?  I could use one but may not have the time to get to it\n" +
  263. "for a while...\n" +
  264. "\n" +
  265. "-keith\n" +
  266. "\n" +
  267. "\n" +
  268. "----\n" +
  269. "keith edwards                 \n" +
  270. "xerox palo alto research center\n" +
  271. "\n" +
  272. "\n" ;
  273. count++;
  274. f[count]="Keith Edwards <kedwards@parc.xerox.com>";
  275. to[count]="Ian Smith <iansmith@Eng>";
  276. s[count]="hey";
  277. d[count]="Fri, 16 Aug 1996 10:55:53 PDT";
  278. text[count]=
  279. "\n" +
  280. "Ian Smith writes:\n" +
  281. " > I don't think I can make happy hour today but I would be up for doing\n" +
  282. " > something tonight in SF. Has there ever been any thought of:\n" +
  283. " > \n" +
  284. " > Edinborough Castle?  The theater? Escape from LA? The Crow II?\n" +
  285. " > \n" +
  286. " > ian\n" +
  287. "\n" +
  288. "You know, I could *really* be up for a movie.  What's the best way to\n" +
  289. "track you down?  As usual, I doubt there will be any consensus prior\n" +
  290. "to bar-time.\n" +
  291. "\n" +
  292. "-k\n" +
  293. "\n" +
  294. "----\n" +
  295. "keith edwards                 \n" +
  296. "xerox palo alto research center\n" +
  297. "\n" +
  298. "\n" ;
  299. count++;
  300. f[count]="hudson@cc.gatech.edu (Scott Hudson)";
  301. to[count]="iansmith@cc.gatech.edu";
  302. s[count]="Panner is done";
  303. d[count]="Fri, 16 Aug 1996 16:50:19 -0400 (EDT)";
  304. text[count]=
  305. "\n" +
  306. "\n" +
  307. "OK, panner is done and in.  Part1 now exports the horizontal scrollbar position\n" +
  308. "and part2 does the vertical.  There is now a test/panner_test.\n" +
  309. "\n" +
  310. "Scott\n" +
  311. "\n" +
  312. "\n" +
  313. "\n" ;
  314. count++;
  315. f[count]="debbiev@uselabs (Debbie Vaughan)";
  316. to[count]="online-team-interest@bird, hci-mtv+@hittite, ia-teamleads@infobot";
  317. s[count]="UPDATE - Developer Tools Online Help Usability Study";
  318. d[count]="Fri, 16 Aug 1996 14:14:09 -0700";
  319. text[count]=
  320. "\n" +
  321. "Hi all, \n" +
  322. "\n" +
  323. "I am in the process of recruiting participants for the other time slots,\n" +
  324. "but I wanted to let you know about the participants who have already \n" +
  325. "been recruited so that you could make your observation plans.\n" +
  326. "\n" +
  327. "Thank You,\n" +
  328. "\n" +
  329. "    /\\        Debbie Vaughan, Usability Lab Coordinator\n" +
  330. "   \\\\ \\       SunSoft Usability Labs\n" +
  331. "  \\ \\\\ /      2550 Garcia Avenue, MS: MPK18-107\n" +
  332. " / \\/ / /     Mountain View, CA  94043-1100\n" +
  333. "/ /   \\//\\    \n" +
  334. "\\//\\   / /    Phone:    (415) 786-4669 direct (x84669 - internal)\n" +
  335. " / / /\\ /     Fax:      (415) 786-4096\n" +
  336. "  / \\\\ \\      EMail:       debbie.vaughan@sun.com\n" +
  337. "   \\ \\\\       \n" +
  338. "    \\/        \n" +
  339. "\n" +
  340. "\n" +
  341. "********************************************************************************\n" +
  342. "\n" +
  343. "\n" +
  344. "USABILITY STUDY SCHEDULE  \n" +
  345. "=========================================\n" +
  346. "PROJECT NAME        IA Online Help\n" +
  347. "STUDY TITLE        Developer Tools Online Help\n" +
  348. "BRIEF DESCRIPTION     Evaluate and compare Java and C++ developer tools \n" +
  349. "            created at Sun. Come see prototypes and brand new\n" +
  350. "             products. Use these tools to perform programming tasks \n" +
  351. "            and then provide feedback to improve these tools.  \n" +
  352. "            Study conducted at Sun's Menlo Park campus.        STUDY REPORT #        96-30\n" +
  353. "USABILITY LAB         MPK18-Lab 3 \n" +
  354. "OBSERVATION LOC.    CntlRm3 1361\n" +
  355. "PILOT DATE        Monday August 19\n" +
  356. "STUDY DATES        Tuesday August 20 - Thursday August 22\n" +
  357. "LENGTH OF STUDY        2 hours per participant\n" +
  358. "REQUESTING COMPANY    IA Online Help team\n" +
  359. "STUDY DOCUMENTATION    Contact Meghan Ede, mede@eng, X84685\n" +
  360. "USABILITY ENGINEER    Scott Joaquim, joaquim@eng, x88636\n" +
  361. "            Meghan Ede, mede@eng, x84685\n" +
  362. "TEST TEAM E-MAIL    online-team-interest@bird, hci-mtv+@hittite,\n" +
  363. "            ia-teamleads@infobot           \n" +
  364. "\n" +
  365. "HCI-LAB SET UP TEAM      \n" +
  366. "    Lab Coordinator - Debbie Vaughan, debbie.vaughan@eng.sun.com, x84669\n" +
  367. "      Lab Technician  - Scott Stephenson, scott.stephenson@Eng, x84556\n" +
  368. "\n" +
  369. "RECRUITING REQUIREMENTS (including pilot):\n" +
  370. "\n" +
  371. "\n" +
  372. "\n" +
  373. "SCHEDULE OF PARTICIPANTS (to be updated as scheduling is confirmed)\n" +
  374. "======================== \n" +
  375. "Part.#    DAY, DATE        Time    Company/Job Type\n" +
  376. "~~~~~~~    ~~~~~~~~~~~~~        ~~~~~    ~~~~~~~~~~~~~~~~~~~~~\n" +
  377. "\n" +
  378. "\n" +
  379. "\n" +
  380. "P#1    Monday, 8/19        11:00    SUN/SOFTWARE SYSTEMS ENGINEER\n" +
  381. "\n" +
  382. "P#2    Monday, 8/19         3:00    SUN/SYS. SOFTWARE ENGINEER\n" +
  383. "\n" +
  384. "#1    Tuesday, 8/20         9:00\n" +
  385. "\n" +
  386. "#2    Tuesday, 8/20        12:30\n" +
  387. "\n" +
  388. "#3    Tuesday, 8/20         3:00\n" +
  389. "\n" +
  390. "#4    Wednesday, 8/21         8:30\n" +
  391. "\n" +
  392. "#5    Wednesday, 8/21         3:30\n" +
  393. "\n" +
  394. "#6    Thursday, 8/22         8:30\n" +
  395. "\n" +
  396. "#7    Thursday, 8/22        11:00    INDEP. CONTRACTOR/SOFTWARE ENG.\n" +
  397. "\n" +
  398. "#8    Thursday, 8/22         5:00    SYSTEMS SCIENCE/SR. SOFTWARE ENG.\n" +
  399. "\n" +
  400. "\n" +
  401. "\n" +
  402. "\n" ;
  403. count++;
  404. f[count]="bryce@doppio (Bryce Glass)";
  405. to[count]="iansmith@klimpt";
  406. s[count]="Coming Down?";
  407. d[count]="Fri, 16 Aug 1996 15:27:18 -0700";
  408. text[count]=
  409. "\n" +
  410. "Hey ian -- you coming down today to test your stuff out?\n" +
  411. "\n" +
  412. "--bryce\n" +
  413. "\n" +
  414. "\n" ;
  415. count++;
  416. f[count]="Keith Edwards <kedwards@parc.xerox.com>";
  417. to[count]="subarctic-discuss@cc.gatech.edu";
  418. s[count]="color picker interactor?";
  419. d[count]="Fri, 16 Aug 1996 10:50:59 PDT";
  420. text[count]=
  421. "\n" +
  422. "Has anyone written (or is anyone planning to write) a color picker\n" +
  423. "interactor?  I could use one but may not have the time to get to it\n" +
  424. "for a while...\n" +
  425. "\n" +
  426. "-keith\n" +
  427. "\n" +
  428. "\n" +
  429. "----\n" +
  430. "keith edwards                 \n" +
  431. "xerox palo alto research center\n" +
  432. "\n" +
  433. "\n" ;
  434. count++;
  435.  
  436.     /*
  437.      * Build the message objects 
  438.      */
  439.     for (i=0; i<number_messages;++i) {
  440.       message m=new message(f[i], d[i], s[i], to[i], text[i]);
  441.       result.addElement(m);
  442.     }
  443.     /*
  444.      * Return 
  445.      */
  446.     return result;
  447.   }
  448.  
  449. }
  450. /*=========================== COPYRIGHT NOTICE ===========================
  451.  
  452. This file is part of the subArctic user interface toolkit.
  453.  
  454. Copyright (c) 1996 Scott Hudson and Ian Smith
  455. All rights reserved.
  456.  
  457. The subArctic system is freely available for most uses under the terms
  458. and conditions described in 
  459.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  460. and appearing in full in the lib/interactor.java source file.
  461.  
  462. The current release and additional information about this software can be 
  463. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  464.  
  465. ========================================================================*/
  466.